#pragma once

/*
*	Trade System (Buy, Sell, Cover and Short conditions)
*/
enum STRATEGIES_ID : byte { TWO_MA_CROSS };

class TradeSystem
{
	protected:
		double _stopLossPoint;
		double _stopGainPoint;
		double _buyPrice;
		double _sellPrice;
		double _coverPrice;
		double _shortPrice;

		bool CrossAbove(vector<double> *vet1, vector<double> *vet2);

	public:
		virtual bool Buy(Quotation stockQuot, int i) { return false; }
		virtual int Sell(Quotation stockQuot, int i) { return 0; }
		virtual int Cover(Quotation stockQuot, int i) { return 0; }
		virtual bool Short(Quotation stockQuot, int i) { return false; }

		double GetBuyPrice() { return this->_buyPrice; }
		double GetSellPrice() { return this->_sellPrice; }
		double GetShortPrice() { return this->_shortPrice; }
		double GetCoverPrice() { return this->_coverPrice; }

		double ApplyStop(bool stopGain, double basePrice, double tradePrice);

		TradeSystem(void);
		TradeSystem(double stopLoss, double stopGain);
		~TradeSystem(void);
};